package com.linjacy.httpproject.mqConsumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@Slf4j
@RabbitListener(queues = "TestDirectQueue")
public class DirectConsumer {

    @RabbitHandler
    public void process(Map data){
        log.info("接收消息");
        data.forEach((k, v) -> {
            log.info("key为：" + k + "value为：" + v);
        });
    }
}
